package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.example.consts.CommonVar;
import org.example.dao.ClientBusinessMapper;
import org.example.pojo.ClientBusinessDo;
import org.example.service.ClientBusinessServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class ClientBusinessServcieImpl implements ClientBusinessServcie {

    @Autowired
  private   ClientBusinessMapper clientBusinessMapper;


    @Override
    @Cacheable(value = CommonVar.CLIENT_REDIS_KEY,key="#appKey")
    public ClientBusinessDo getAppkey(String appKey) {
        ClientBusinessDo clientBusinessDo =
                clientBusinessMapper.selectOne(new LambdaQueryWrapper<ClientBusinessDo>().eq(ClientBusinessDo::getApikey, appKey));
        return clientBusinessDo;
    }
}
